//
//  searchView.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/26.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "searchView.h"
@interface searchView()
@end
@implementation searchView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self creatUI];
    }
    return self;
}
- (void)creatUI
{
    if (_baseView == nil) {
        //底部灰色
        _baseView = [[UIView alloc]initWithFrame:CGRectMake(10*screenW_6,5*screenW_6, SCREENW -20*screenW_6,35*screenW_6)];
        _baseView.backgroundColor = [UIColor colorWithHexString:@"f5f5f5"];
        _baseView.layer.cornerRadius = 17.5*screenW_6;
        _baseView.layer.masksToBounds = YES;
        [self addSubview:_baseView];
        
        //搜索图片
        _searchImageV = [TomamaUI createImageView:CGRectMake(15*screenW_6, 7, 4*16/3, 20) backGroundImageV:@"search"];
        [_baseView addSubview:_searchImageV];
        
        //输入框
        _textF = [[UITextField alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_searchImageV.frame) + 5*screenW_6,0, _baseView.frame.size.width - CGRectGetMaxX(_searchImageV.frame) - 25*screenW_6,35*screenW_6)];
        _textF.placeholder = @"地址搜索";
        _textF.textColor = TextBlack;
        _textF.returnKeyType = UIReturnKeyDone;
        _textF.userInteractionEnabled = YES;
        [_textF setValue:[UIColor colorWithHexString:@"#999999"] forKeyPath:@"_placeholderLabel.textColor"];
        [_baseView addSubview:_textF];
    }
}


@end
